In today's computing environments, applications rely on operating systems to function. Operating systems provide a software platform on top of which applications can run. Operating systems perform basic tasks, such as recognizing input from a keyboard and mouse, sending output to a display screen, keeping track of files and directories on a hard disk drive, and controlling peripheral devices such as printers. Modern operating systems take a modular approach to supporting various applications. For example, a given operating system may make available a number of functions—those functions residing in a series of programming modules. However, a given application may only need a few of those functions. Consequently, programming for all of the functions provided by the operating system need not be loaded into a computer's memory—only the programming for those functions used by the application.
When an application is executed and loaded into a computer's memory, the operating system identifies and also loads into memory each of the operating system's modules that supply functions needed by the application. Such a module might include a common dialog function for presenting an interface enabling a user to select options for tasks such as opening a file, printing, and page setup. For these purposes, Microsoft Windows® supplies the functions GetOpenFileName, PrintDlg, and PageSetupDlg. All applications compatible with the operating system can call on one or all of these functions. Beneficially, the user need only become familiar with a single interface for completing a particular task regardless of the application being used.
An operating system's common dialog functions require user interaction. For example, a user desiring to print a document using a word processor selects a print icon causing the word processor to call the operating systems common dialog function for printing. The printing common dialog function presents an interface enabling the user to select a printer and other production options such as the number of copies and the page range or ranges to be printed. With the selections made the user closes the interface and the print dialog function returns production data representing the user selections to the word processor. The word processor then directs the selected printer to produce the document accordingly.
Often, however, it is desirable for other programming to provide the necessary interaction needed to utilize a given common dialog function. For example, a user may desire that programming operating on a server print a document. Where the server is geographically separated from the user, the user is not able to provide the interaction needed to direct the programming on the server to print the document. The user must instead rely on other programming operating on the server to supply the needed interaction. Unfortunately, programming designed to mimic human interaction is often cumbersome and unreliable.
This problem reveals a need for a method for intercepting a call to common dialog function and redirecting the call to a module that gathers settings from a programmatic interface and that can return selections normally provided by a user. The same techniques used to achieve this goal can be used for a variety of other purposes such as providing a user with a more specialized interface than those provided by an operating system's common dialog functions.